home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap06 / FoneList / FoneList.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.4 KB  |  74 lines

  1. //***********************************************************************
  2. //
  3. //  FoneList.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CNumEdit : public CEdit
  8. {
  9. protected:
  10.     afx_msg void OnChar (UINT, UINT, UINT);
  11.     DECLARE_MESSAGE_MAP ()
  12. };
  13.  
  14. class CFoneListBox : public CListBox
  15. {
  16. private:
  17.     CFont m_font;
  18.  
  19. public:
  20.     virtual BOOL PreCreateWindow (CREATESTRUCT&);
  21.     void PromptForNewEntry ();
  22.  
  23. protected:
  24.     afx_msg int OnCreate (LPCREATESTRUCT);
  25.     afx_msg void OnEditItem ();
  26.  
  27.     DECLARE_MESSAGE_MAP ()
  28. };
  29.  
  30. class CMyApp : public CWinApp
  31. {
  32. public:
  33.     virtual BOOL InitInstance ();
  34. };
  35.  
  36. class CMainWindow : public CFrameWnd
  37. {
  38. private:
  39.     CFoneListBox m_ctlListBox;
  40.  
  41. public:
  42.     CMainWindow ();
  43.  
  44. protected:
  45.     afx_msg int OnCreate (LPCREATESTRUCT);
  46.     afx_msg void OnSize (UINT, int, int);
  47.     afx_msg void OnOptionsNew ();
  48.     afx_msg void OnOptionsExit ();
  49.  
  50.     DECLARE_MESSAGE_MAP ()
  51. };
  52.  
  53. class CEditDialog : public CDialog
  54. {
  55. public:
  56.     CString m_strName;
  57.     CString m_strPhone;
  58.  
  59.     CBitmapButton m_ctlOKButton;
  60.     CBitmapButton m_ctlCancelButton;
  61.     CNumEdit m_ctlPhone;
  62.  
  63.     CEditDialog (CWnd* pParentWnd = NULL) :
  64.         CDialog (IDD_EDITDLG, pParentWnd) {}
  65.  
  66.     virtual BOOL OnInitDialog ();
  67.  
  68. protected:
  69.     virtual void DoDataExchange (CDataExchange*);
  70.     afx_msg void OnUpdateOKButton ();
  71.  
  72.     DECLARE_MESSAGE_MAP ()
  73. };
  74.